import requests

s = requests.Session()
# s.get('http://localhost/agileone/index.php')

datas = {'username': 'admin', 'password': 'admin', 'savelogin': 'true'}
headers = {'Accept': '*/*', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}
r = s.post('http://localhost/agileone/index.php/common/login', data=datas, headers=headers)
print(r.text)

# datas = {'headline': 'headline测试', 'content': '内容', 'scope':a.txt, 'expireddate':'2018-01-09'}
datas = 'headline=222111111111111111111&content=111111111111111111&scope=a.txt&expireddate=2018-01-09'
headers = {'Accept': '*/*', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}
r = s.post('http://localhost/agileone/index.php/notice/add', data=datas, headers=headers)
print(r.text)
